package com.neusoft.service.impl;

import java.util.List;

import com.neusoft.bean.User;
import com.neusoft.dao.UserDao;
import com.neusoft.dao.impl.UserDaoImpl;
import com.neusoft.service.UserService;

public class UserServiceImpl implements UserService{
	UserDao userDao = new UserDaoImpl();
	@Override
	public User findUserByNP(User user) {
		int id  = userDao.findUserByNP(user);
		User newUser = userDao.findUserById(id);
		return newUser;
	}
	@Override
	public int showUserCount() {
		
		return userDao.showUserCount();
	}
	@Override
	public void addUser(User user) {
		userDao.addUser(user);
	}
	public List<User> showUser(int page,int row) {
		return userDao.showUser(row*(page-1)+1,row*page);
	}
	@Override
	public void delUser(int id) {
		userDao.delUser(id);
	}
	@Override
	public User findUserByName(String username) {
		return userDao.findUserByName(username);
	}
	@Override
	public User findUserById(int id){
		return userDao.findUserById(id);
	}
	@Override
	public void updateUser(User user) {
		userDao.updateUser(user);
		
	}
	
	
	
}
